var dependencies=["orb/features/_skiplinks","orb/features/masthead/_layoutprimarynav"];function removeElement(e,t){return e.filter(function(e){})}window.bbcpage.isModal()&&(dependencies=removeElement(dependencies,"orb/features/masthead/_layoutprimarynav")),require(dependencies,function(){"use strict";for(var e=0,t=arguments.length;e/g,">").replace(/"/g,""")},trimHtml:function(e,t){var n="",r=0;return e.replace(/(<.+?>|&.+?;|[^<&]+)/g,function(e){switch(e.charAt(0)){case"<":e=t<=r&&/\/>/.test(e)?"":e,r+=0;break;case"&":e=t<=r?"":e,r+=1;break;default:e=e.substr(0,t-r),r+=e.length}n+=e}),n=n.replace(/\s+(<[^>]+>)$/,"$1").replace(/<(\w+)><\/\1>/g,"").replace(/\s+$/,""),n+=e!==n?"…":""}}}),define("orb/lib/_template",function(){"use strict";var a={};return function e(t,n){var r="#"===(t=t.replace(/(^\s*\s*$)/g,"")).charAt(0)?a[t]=a[t]||e(document.getElementById(t.slice(1)).innerHTML):new Function("obj","var p=[],esc=function(v){return (''+v).replace(/&/g, '&').replace(/)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return n?r(n):r}}),define("orb/lib/_$",["orb/lib/_nut","orb/lib/_ready","orb/lib/_anim","orb/lib/_dom","orb/lib/_event","orb/lib/_classy","orb/lib/_attr","orb/lib/_str","orb/lib/_script","orb/lib/_template","orb/lib/_onloadCSS"],function(e,t,n,r,a,i,o,s,l,c,d){"use strict";var u=e,f=u("#orb-banner")[0],h=u("#orb-header")[0];return u.anim=n.animate,u.ready=t,u.remove=r.remove,u.addEvent=a.addEvent,u.addClass=i.addClass,u.removeClass=i.removeClass,u.hasClass=i.hasClass,u.getAttr=o.getAttr,u.setAttr=o.setAttr,u.str=s,u.script=l,u.template=c,u.onloadCSS=d,u.client={old_ie:u.hasClass(f,"orb-old-ie"),ie8:u.hasClass(f,"orb-ie8"),ie7:u.hasClass(f,"orb-ie7"),ie6:u.hasClass(f,"orb-ie6")},u.config={fixed:u.hasClass(h,"orb-fixed-width")||u.client.old_ie,rtl:"rtl"===u.getAttr(h,"dir")},u.addCSS=function(e){if("string"!=typeof e||""===e)return!1;try{var t=document.createElement("style");return t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),document.getElementsByTagName("head")[0].appendChild(t),!0}catch(e){return!1}},u.addHTML=function(e,t){return!(!e||!e.tagName||""===t)&&(e.innerHTML=t,!0)},u}),define("orb/features/masthead/_drawer",["orb/lib/_$","orb/lib/_event"],function(n,r){"use strict";function e(e){r.mixin(this),this.content=e,this._currentPanel=null,this.panels={},this.panelName=null}return e.prototype.addPanel=function(e){return(this.panels[e.name]=e).drawer=this},e.prototype.getPanel=function(e){return e?this.panels[e]:this._currentPanel},e.prototype.resize=function(e){if(this._currentPanel&&this._currentPanel.name===e){var t=this.panels[e].content.offsetHeight+"px";n("#orb-panels")[0].style.height=t}},e.prototype.showPanel=function(e){var t=this._currentPanel;null===t?(this.panelName=e,this.event("onActivate").fire({}),this._currentPanel=this.panels[e],this._currentPanel.publishState("shown")):t&&t.name===e?this.hidePanel():(this.deactivatedPanelName=this._currentPanel.name,this._currentPanel.publishState("hidden"),this.panelName=e,this._currentPanel=this.panels[e],this.event("onSwapContents").fire({}),this._currentPanel.publishState("shown"))},e.prototype.hidePanel=function(){var e=this._currentPanel;null!==e&&(this.event("onDeactivate").fire({}),e.publishState("hidden"),this.panelName=null,this._currentPanel=null)},e.prototype.activate=function(){this._currentPanel&&this.showPanel(this._currentPanel.name)},e.prototype.deactivate=function(){this.hidePanel()},e.prototype.getCurrentPanel=function(){return this._currentPanel},e.Panel=function(e,t,n){this.name=e,t&&(this.control=t.control,this.content=t.content),this.publishState=function(e){"function"==typeof this.stateChangeCallback&&this.stateChangeCallback.call(null,e)},"function"==typeof n&&(this.stateChangeCallback=n),r.mixin(this)},e}),define("orb/features/masthead/_layoutprimarynav",["orb/lib/_$","orb/lib/_event","orb/api","orb/features/masthead/_linkmanager","orb/features/_drawerManager","orb/features/_moreDrawer"],function(l,e,t,c,s,d){"use strict";var u=new c(l(".orb-nav-links li").slice(0,-1)),f=!1,h=l(".orb-nav-search")[0],v=l("#orb-nav-more")[0],m=l("#orb-header")[0],b=l(".orb-nav-pri-container")[0],p="orb-nav-dyn",g="orb-nav-empty",y="orb-nav-lock",C=1,w=l("#orb-nav-more a")[0],_=w.firstChild.data,k=l.getAttr(w,"data-alt");function E(){function n(){var e,t,n,r;e=E.event("beforeLayout"),t=E.event("afterLayout"),n={links:u.links},r=b.offsetTop,e.fire(n),l.addClass(v,"orb-nav-hide"),u.showAll();var a=u.getLastItem();h.offsetTop===r&&a&&a.offsetTop===r||(function(){var e,t,n;l.removeClass(v,"orb-nav-hide");var r=w.getAttribute("style");v.style.width="auto",w.style.textIndent="0",w.firstChild.data=k,e=v.offsetWidth,w.firstChild.data=_,t=v.offsetWidth,n=Math.max(e,t),v.style.width=n+"px",w.setAttribute("style",r)}(),u.hideToFit(function(e){if(v.offsetTop!==r||h.offsetTop!==r)return!0},C)),t.fire(n)}function r(){l.addClass(b,y)}function a(){l.removeClass(b,y),t.trigger("layout",{width:b.offsetWidth,height:b.offsetHeight})}function i(){var e,t=0;return function(){window.innerWidth!==t&&(t=window.innerWidth,r(),e&&clearTimeout(e),e=setTimeout(function(){n(),d.layoutMorePanelContent(),a()},100))}}function o(){var e={isNull:!0,offsetLeft:-1,offsetWidth:0},t=l(".orb-nav-search")[0]||e,n=l("#orb-nav-links")[0]||e,r=l("#orb-nav-more")[0]||e,a=(l(".orb-nav-id")[0],0);a=l.config.rtl?l.client.ie6||l.client.ie7?function(){return t.offsetLeft+r.offsetLeft+1}:function(){return r.offsetLeft-(t.offsetLeft+t.offsetWidth)}:function(){return t.offsetLeft-n.offsetLeft-n.offsetWidth},E.event("afterLayout").add(function(e){r.style.width=r.offsetWidth+a()-3+"px"})}function e(e){window.orb&&!e&&function(){var e=l(".orb-nav-links ul li"),t=window.orb.worldwideNavlinks;if(t){l(".orb-footer-primary-links ul")[0].innerHTML=t;for(var n=0,r=e.length;n";t.innerHTML=e}(),n(),u.addClass(u("html")[0],"orb-more-loaded")}return t.setAttribute("id","orb-panel-more"),u.addClass(t,"orb-panel"),r.layoutMorePanelContent=n,r}),define("orb/features/_drawerManager",["orb/lib/_$","orb/features/masthead/_drawer"],function(s,e){"use strict";var i=new e(s("#orb-panels")[0]),l=s("#orb-header")[0],c="orb-nav-focus-on",d=400,u="orb-panel-active",f="orb-nav-active",h="orb-first-visible";function a(e){var t;for(void 0===e.length&&(e=[e]),t=e.length;t--;){if(document.activeElement&&document.activeElement===e[t])return!0;if(document.focusNode&&document.focusNode===e[t])return!0}return!1}function r(e){var o,a=null,t=window.getComputedStyle?function(e){return e=e||document.body,window.getComputedStyle(e).fontSize.replace("px","")}:function(e){var t,n;return e=e||document.body,(t=document.createElement("div")).style.margin="0px",t.style.padding="0px",t.style.border="none",t.style.height="1em",e.appendChild(t),n=t.offsetHeight,e.removeChild(t),n};function n(){var e=i.getCurrentPanel();null!==e&&function(e){s.hasClass(i.content,u)&&(i.content.style.height=e.content.offsetHeight/t(i.content)+"em")}(e)}r.initPanelDom=function(e,t){var n,r,a=s.template(o),i=document.createElement("div");return n=a({panelcontent:function(e){return"more"===e?'

":""}(e),panelname:e}),i.innerHTML=n,i=function(e){for(var t=e.firstChild;t;){if(1===t.nodeType)return t;t=t.nextSibling}return null}(i).cloneNode(!0),t.appendChild(i),s.addClass(s(".orb-panel-content")[0],"orb-nav-sec"),(r=s("#"+i.getAttribute("aria-labelledby"))[0])&&s.setAttr(r,"aria-controls",i.id),{control:r,content:i}},s.ready(function(){!function(){var e=s("#orb-panel-template")[0];e&&(o=e.innerHTML,e.parentNode.removeChild(e))}(),(l.drawer=i).event("onActivate").add(function(){!function(e){var t,n,r=e.control;e&&(clearTimeout(a),r&&s.addClass(r,c),i.content.style.height="0",e.content.style.display="block",t=e.content.offsetHeight,"mouse"===l.navMode?(s.anim(i.content,{height:t,duration:d}),s.setAttr(e.content,"tabindex","-1"),e.content.focus()):(s.anim(i.content,{height:t,duration:0}),(n=s("."+h+" a",e.content)[0]||s("."+h+" a",e.content)[0]||s(".orb-focus-target",e.content)[0])&&n.focus()),s.setAttr(i.content,"aria-expanded","true"),s.addClass(i.content,u),s.addClass(l,f))}(i.getPanel(i.panelName))}),i.event("onDeactivate").add(function(){!function(e){var t=e.control;e&&(clearTimeout(a),"mouse"===l.navMode?s.anim(i.content,{height:0,duration:d}):s.anim(i.content,{height:0,duration:0}),a=setTimeout(function(){e.content.style.display="none",s.removeClass(i.content,u),s.removeClass(l,f),s.setAttr(i.content,"aria-expanded","false"),t&&s.removeClass(t,c)},"mouse"===l.navMode?d:0))}(i.getPanel())}),i.event("onSwapContents").add(function(){!function(e,t){var n,r=e.control,a=t.control;e.content.style.display="none",t.content.style.display="block",n=t.content.offsetHeight,"mouse"===l.navMode?(s.anim(i.content,{height:n,duration:d}),s.setAttr(t.content,"tabindex","-1"),t.content.focus()):(s.anim(i.content,{height:n,duration:0}),s("."+h+" a",t.content)[0].focus()),s.removeClass(r,c),s.addClass(a,c)}(i.panels[i.deactivatedPanelName],i.getPanel())}),n(),s.addEvent(l,"mousemove",function(e){l.navMode="mouse"}),s.addEvent(l,"mousedown",function(e){l.navMode="mouse"}),s.addEvent(l,"keydown",function(e){l.navMode="keyboard"}),e.event("afterLayout").add(n)}),r.refreshNav=function(){e.recalculateLayout()}}return r.addPanelEvents=function(n){var r=n.name;s.addEvent(n.control,"click",function(e){return n.event("beforeshow").fire(e),i.showPanel(r),n.event("show").fire(e),e.preventDefault?e.preventDefault():e.returnValue=!1,!1}),s.addEvent(l,"keydown",function(e){if(27===("number"==typeof e.which?e.which:e.keyCode)&&(a(n.control)||a(s("a,button",n.content))||a(n.content))){i.hidePanel(r);var t=s("a",n.control)[0];t&&t.focus()}})},r.getMastheadDrawer=function(){return i},r}),define("orb/features/_skiplinks",["orb/lib/_$"],function(r){"use strict";return function(){r.ready(function(){var e=r(".orb-skip-links")[0];r.addEvent(e,"click",function(e){var t=(e.target||e.srcElement).getAttribute("href").match(/^(#.+)/),n=(t?r(t[1]):[])[0];n&&(null!==n.tabIndex&&-1!==n.tabIndex||(n.tabIndex=-1),n.focus())})})}}),define("orb/nav",["orb/lib/_$","orb/features/_drawerManager","orb/features/masthead/_drawer"],function(i,o,s){"use strict";return{loadCss:function(e,t){var n=loadCSS(e);"function"==typeof t&&i.onloadCSS(n,t)},loadJs:function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,t.async=!0,document.getElementsByTagName("body")[0].appendChild(t)},addDrawer:function(e,t,n,r){i("#orb-panels")[0].appendChild(n);var a=new s.Panel(e,{control:t,content:n},r);o.getMastheadDrawer().addPanel(a),o.addPanelEvents(a)},getDrawerState:function(e){var t=o.getMastheadDrawer().getCurrentPanel();return null===t||t.name!=e?"hidden":"shown"},updateDrawerHeight:function(e){o.getMastheadDrawer().resize(e)},getMastheadDrawer:function(){return o.getMastheadDrawer()},refresh:function(){o.refreshNav&&o.refreshNav()}}}); //# sourceMappingURL=orb.min.js.map